chronicle Showcase

Philippe Heymans Smith

2021-03-03

This is how a chronicle report looks

This is a showcase of the outputs possible with the {chronicle} R package. For a complete how-to, please refer to the package’s github page.

Barplots

Simple bar plot

Bars broken by other group

Bars sorted by value

Bars sorted by value and broken by another column

Horizontally

Boxplots

Simple box plot

Box plot by groups

Box plot with jitter

Code

This is an empty canvas for you to include any code you want.

This is some code:

data.table(iris)[, .N, Species]

It can also be evaluated!

library(data.table)
data.table(iris)[, .N, Species]
##       Species  N
## 1:     setosa 50
## 2: versicolor 50
## 3:  virginica 50

Densities

Basic density

Density by group

Faceted densities

dygraphs

Simple dygraph (in static outputs it will be replaced by line plots)

Dygraph by groups

Histograms

Basic histogram

Faceted histogram by groups

Line plots

Simple line plot

Line plot with trend

Line plot with linear trend

Faceted line plot

Rain cloud plots

Simple rain cloud

Rain cloud by group

Larger denisty kernel

No boxplot, just the median

With the mean instead of the boxplot

Scatter plots

Simple scatter plot

Scatter plot with groups

Faceted scatter plot with trend

Tables

kable

Sepal.Length Sepal.Width Petal.Length Petal.Width Species
5.1 3.5 1.4 0.2 setosa
4.9 3.0 1.4 0.2 setosa
4.7 3.2 1.3 0.2 setosa
4.6 3.1 1.5 0.2 setosa
5.0 3.6 1.4 0.2 setosa
5.4 3.9 1.7 0.4 setosa

DT

Violins

Simple violin plot

Violin plot by group

sessionInfo()
## R version 4.0.3 (2020-10-10)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 10 x64 (build 19042)
## 
## Matrix products: default
## 
## locale:
## [1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    
## 
## attached base packages:
## [1] stats     graphics  grDevices utils     datasets  methods   base     
## 
## other attached packages:
## [1] chronicle_0.2.5   data.table_1.13.6 magrittr_2.0.1    rlang_0.4.10     
## 
## loaded via a namespace (and not attached):
##  [1] zoo_1.8-8         tidyselect_1.1.0  xfun_0.20         purrr_0.3.4       splines_4.0.3     lattice_0.20-41   colorspace_2.0-0 
##  [8] vctrs_0.3.6       generics_0.1.0    htmltools_0.5.0   viridisLite_0.3.0 yaml_2.2.1        mgcv_1.8-33       utf8_1.1.4       
## [15] plotly_4.9.3      pillar_1.4.7      glue_1.4.2        withr_2.3.0       lifecycle_0.2.0   stringr_1.4.0     tictoc_1.0       
## [22] munsell_0.5.0     gtable_0.3.0      htmlwidgets_1.5.3 evaluate_0.14     labeling_0.4.2    knitr_1.31        rmdformats_1.0.1 
## [29] crosstalk_1.1.0.1 fansi_0.4.1       highr_0.8         xts_0.12.1        readr_1.4.0       scales_1.1.1      DT_0.17          
## [36] jsonlite_1.7.2    gridExtra_2.3     ggplot2_3.3.3     hms_0.5.3         digest_0.6.27     stringi_1.5.3     bookdown_0.21    
## [43] dplyr_1.0.2       grid_4.0.3        cli_2.2.0         tools_4.0.3       lazyeval_0.2.2    tibble_3.0.4      crayon_1.3.4     
## [50] tidyr_1.1.2       pkgconfig_2.0.3   ellipsis_0.3.1    Matrix_1.2-18     dygraphs_1.1.1.6  assertthat_0.2.1  rmarkdown_2.6    
## [57] httr_1.4.2        rstudioapi_0.13   viridis_0.5.1     R6_2.5.0          nlme_3.1-151      compiler_4.0.3

report_columns()

chronicle also includes a function called report_columns(), that will create an entire chronicle report for a single dataset. It includes a comprehensive summary of the data through the skimr::skim() function, along with one plot for each column present in the data: bar plots for categorical variables and rain cloud plots for numerical variables. This gives you an immediate view of a dataset with a single line of code!

report_columns(dt = palmerpenguins::penguins,
               by_column = 'species')